<?=$this->form_eksternal->form_open()?>
<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span12">
        <div class="widget-block">
          <?php
          if($message == 'filed'){
          ?>
          <div class="alert alert-error fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong>Filed!</strong> Fail to save data.
          </div>
          <?php
          }
          if($message == 'sukses'){
          ?>
          <div class="alert alert-success fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong>Success!</strong> Now you have new user.
          </div>
          <?php
          }
          ?>
          <div class="widget-head">
            <h5><?=$title_table?></h5>
            <div class="widget-control pull-right">
              <a href="#" data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-cog"></i><b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="<?=  site_url("outlet/aktifitas/add-new-report") ?>"><i class="icon-plus"></i> Add New</a></li>
<!--                <li><a href="#"><i class="icon-ok"></i> Active</a></li>
                <li><a href="#"><i class="icon-minus-sign"></i> No-Active</a></li>
                <li><a href="#"><i class="black-icons pdf_document"></i> Export to PDF</a></li>-->
                <li><a href="<?=  site_url("outlet/export-xls") ?>"><i class="black-icons excel_document"></i> Export to XLS</a></li>
              </ul>
            </div>
          </div>
         
          <div class="widget-content">
            <div class="widget-box">
               
              <table class="data-tbl-boxy table">
                <thead>
                  <tr>
                    <th>No</th>
                    <th>Name</th>
                    <th>Bulan</th>
                    <th>Tahun</th>
                    <th>Outlet</th>
                    <th>Option</th>
                    <th>Check</th>
                  </tr>
                </thead>
                <tbody>
                  <?php
                  if(is_array($data)){
                    $no = 1;
                    foreach ($data as $key => $value) {
                      $link_edit = site_url("outlet/aktifitas/detail/".$value->id_actifity_report);
                      $link_day = site_url("outlet/aktifitas/detail/".$value->id_actifity_report."/".date("d"));
                      $tanggal_sekarang = date("d");
//                      $link_history = site_url("outlet/aktifitas/pica/".$value->id_actifity_report);
//                      $link_pica = site_url("outlet/aktifitas/history/".$value->id_actifity_report);
                      $link_pica_new = site_url("pica/index/".$value->id_actifity_report);
                      $link_kunjungan_supervisi = site_url("pica/kunjungan-supervisi/".$value->id_actifity_report);
                      $link_chart = site_url("outlet/aktifitas/unit-entry-chart/".$value->id_actifity_report);
                      $link_xls_half = site_url("outlet/aktifitas/half-export-xls/".$value->id_actifity_report);
                      $link_xls = site_url("outlet/aktifitas/fs-export-xls/".$value->id_actifity_report);
                      $import_activity = site_url("outlet/tambahan/import_activity/".$value->id_actifity_report);
                      $cek_list = $this->form_eksternal->form_checkbox('cek[]', $value->id_actifity_report);
                      
                      $bulan = array(
                          "1" =>  "Januari",
                          "2" =>  "Februari",
                          "3" =>  "Maret",
                          "4" =>  "April",
                          "5" =>  "Mei",
                          "6" =>  "Juni",
                          "7" =>  "Juli",
                          "8" =>  "Agustus",
                          "9" =>  "September",
                          "10" =>  "Oktober",
                          "11" =>  "Nopember",
                          "12" =>  "Desember",
                      );
                      print <<<EOD
                  <tr>
                    <td>{$no}</td>
                    <td>{$value->name}</td>
                    <td>{$bulan[$value->month]}</td>
                    <td>{$value->year}</td>
                    <td>{$value->outlet}</td>
                    <td>
                      <div class="btn-group">
                        <button data-toggle="dropdown" class="btn btn-small dropdown-toggle">Action<span class="caret"></span></button>
                        <ul class="dropdown-menu">
                          <li><a href="{$link_day}">Report Tangal {$tanggal_sekarang}</a></li>
                          <li><a href="{$link_edit}">Detail All</a></li>
                          <li><a href="{$link_pica_new}">PICA</a></li>
                          <li><a href="{$link_kunjungan_supervisi}">Kunjungan Supervisi</a></li>
                          <li><a href="{$link_chart}">Chart</a></li>
                          <li><a href="{$link_xls_half}">Report XLS (1-5)</a></li>
                          <li><a href="{$link_xls}">Report XLS (All)</a></li>
						   <li><a href="{$import_activity}">Import Activity</a></li>
                        </ul>
                       
                      </div>
                    </td>
                    <td>{$cek_list}</td>
                  </tr>
EOD;
                          $no++;
                    }
                  }
                  ?>
                </tbody>
               
              </table>
              <button class="btn btn-primary" type="submit" style>Export XLS</button>
             
            </div>
          </div>
              
        </div>
      </div>
    </div>
  </div>
</div>
 </form>